﻿<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
      <title>RecyclableMemoryStreamManager.Events 类
 | Fantasy.Net API Reference </title>
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <meta name="title" content="RecyclableMemoryStreamManager.Events 类
 | Fantasy.Net API Reference ">
      
      <link rel="icon" href="../favicon.ico">
      <link rel="stylesheet" href="../public/docfx.min.css">
      <link rel="stylesheet" href="../public/main.css">
      <meta name="docfx:navrel" content="../toc.html">
      <meta name="docfx:tocrel" content="toc.html">
      
      <meta name="docfx:rel" content="../">
      
      
      
  </head>

  <script type="module">
    import options from './../public/main.js'
    import { init } from './../public/docfx.min.js'
    init(options)
  </script>

  <script>
    const theme = localStorage.getItem('theme') || 'auto'
    document.documentElement.setAttribute('data-bs-theme', theme === 'auto' ? (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light') : theme)
  </script>

  <body class="tex2jax_ignore" data-layout="" data-yaml-mime="ManagedReference">
    <header class="bg-body border-bottom">
      <nav id="autocollapse" class="navbar navbar-expand-md" role="navigation">
        <div class="container-xxl flex-nowrap">
          <a class="navbar-brand" href="../index.html">
            <img id="logo" class="svg" src="../logo.svg" alt="Fantasy.Net">
            Fantasy.Net
          </a>
          <button class="btn btn-lg d-md-none border-0" type="button" data-bs-toggle="collapse" data-bs-target="#navpanel" aria-controls="navpanel" aria-expanded="false" aria-label="Toggle navigation">
            <i class="bi bi-three-dots"></i>
          </button>
          <div class="collapse navbar-collapse" id="navpanel">
            <div id="navbar">
              <form class="search" role="search" id="search">
                <i class="bi bi-search"></i>
                <input class="form-control" id="search-query" type="search" disabled="" placeholder="搜索" autocomplete="off" aria-label="Search">
              </form>
            </div>
          </div>
        </div>
      </nav>
    </header>

    <main class="container-xxl">
      <div class="toc-offcanvas">
        <div class="offcanvas-md offcanvas-start" tabindex="-1" id="tocOffcanvas" aria-labelledby="tocOffcanvasLabel">
          <div class="offcanvas-header">
            <h5 class="offcanvas-title" id="tocOffcanvasLabel">Table of Contents</h5>
            <button type="button" class="btn-close" data-bs-dismiss="offcanvas" data-bs-target="#tocOffcanvas" aria-label="Close"></button>
          </div>
          <div class="offcanvas-body">
            <nav class="toc" id="toc"></nav>
          </div>
        </div>
      </div>

      <div class="content">
        <div class="actionbar">
          <button class="btn btn-lg border-0 d-md-none" style="margin-top: -.65em; margin-left: -.8em" type="button" data-bs-toggle="offcanvas" data-bs-target="#tocOffcanvas" aria-controls="tocOffcanvas" aria-expanded="false" aria-label="Show table of contents">
            <i class="bi bi-list"></i>
          </button>

          <nav id="breadcrumb"></nav>
        </div>

        <article data-uid="Fantasy.RecyclableMemoryStreamManager.Events">



  <h1 id="Fantasy_RecyclableMemoryStreamManager_Events" data-uid="Fantasy.RecyclableMemoryStreamManager.Events" class="text-break">
    RecyclableMemoryStreamManager.Events 类
  
  </h1>

  <div class="facts text-secondary">
    <dl><dt>命名空间</dt><dd><a class="xref" href="Fantasy.html">Fantasy</a></dd></dl>
  <dl><dt>程序集</dt><dd>Fantasy.Net.dll</dd></dl>
  </div>

  <div class="markdown summary"><p>用于 RecyclableMemoryStream 的 ETW 事件。</p>
</div>
  <div class="markdown conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">[EventSource(Name = &quot;Microsoft-IO-RecyclableMemoryStream&quot;, Guid = &quot;{B80CD4E4-890E-468D-9CBA-90EB7C82DFC7}&quot;)]
public sealed class RecyclableMemoryStreamManager.Events : EventSource, IDisposable</code></pre>
  </div>




  <dl class="typelist inheritance">
    <dt>继承</dt>
    <dd>
      <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></div>
      <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.diagnostics.tracing.eventsource">EventSource</a></div>
      <div><span class="xref">RecyclableMemoryStreamManager.Events</span></div>
    </dd>
  </dl>

  <dl class="typelist implements">
    <dt>实现</dt>
    <dd>
      <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.idisposable">IDisposable</a></div>
    </dd>
  </dl>


  <dl class="typelist derived">
    <dt>继承成员</dt>
    <dd>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.diagnostics.tracing.eventsource.isenabled#system-diagnostics-tracing-eventsource-isenabled">EventSource.IsEnabled()</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.diagnostics.tracing.eventsource.isenabled#system-diagnostics-tracing-eventsource-isenabled(system-diagnostics-tracing-eventlevel-system-diagnostics-tracing-eventkeywords)">EventSource.IsEnabled(EventLevel, EventKeywords)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.diagnostics.tracing.eventsource.isenabled#system-diagnostics-tracing-eventsource-isenabled(system-diagnostics-tracing-eventlevel-system-diagnostics-tracing-eventkeywords-system-diagnostics-tracing-eventchannel)">EventSource.IsEnabled(EventLevel, EventKeywords, EventChannel)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.diagnostics.tracing.eventsource.getguid">EventSource.GetGuid(Type)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.diagnostics.tracing.eventsource.getname">EventSource.GetName(Type)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.diagnostics.tracing.eventsource.generatemanifest#system-diagnostics-tracing-eventsource-generatemanifest(system-type-system-string)">EventSource.GenerateManifest(Type, string)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.diagnostics.tracing.eventsource.generatemanifest#system-diagnostics-tracing-eventsource-generatemanifest(system-type-system-string-system-diagnostics-tracing-eventmanifestoptions)">EventSource.GenerateManifest(Type, string, EventManifestOptions)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.diagnostics.tracing.eventsource.getsources">EventSource.GetSources()</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.diagnostics.tracing.eventsource.sendcommand">EventSource.SendCommand(EventSource, EventCommand, IDictionary&lt;string, string&gt;)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.diagnostics.tracing.eventsource.gettrait">EventSource.GetTrait(string)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.diagnostics.tracing.eventsource.tostring">EventSource.ToString()</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.diagnostics.tracing.eventsource.setcurrentthreadactivityid#system-diagnostics-tracing-eventsource-setcurrentthreadactivityid(system-guid)">EventSource.SetCurrentThreadActivityId(Guid)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.diagnostics.tracing.eventsource.setcurrentthreadactivityid#system-diagnostics-tracing-eventsource-setcurrentthreadactivityid(system-guid-system-guid@)">EventSource.SetCurrentThreadActivityId(Guid, out Guid)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.diagnostics.tracing.eventsource.dispose#system-diagnostics-tracing-eventsource-dispose">EventSource.Dispose()</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.diagnostics.tracing.eventsource.write#system-diagnostics-tracing-eventsource-write(system-string)">EventSource.Write(string)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.diagnostics.tracing.eventsource.write#system-diagnostics-tracing-eventsource-write(system-string-system-diagnostics-tracing-eventsourceoptions)">EventSource.Write(string, EventSourceOptions)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.diagnostics.tracing.eventsource.write#system-diagnostics-tracing-eventsource-write-1(system-string-0)">EventSource.Write&lt;T&gt;(string, T)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.diagnostics.tracing.eventsource.write#system-diagnostics-tracing-eventsource-write-1(system-string-system-diagnostics-tracing-eventsourceoptions-0)">EventSource.Write&lt;T&gt;(string, EventSourceOptions, T)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.diagnostics.tracing.eventsource.write#system-diagnostics-tracing-eventsource-write-1(system-string-system-diagnostics-tracing-eventsourceoptions@-0@)">EventSource.Write&lt;T&gt;(string, ref EventSourceOptions, ref T)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.diagnostics.tracing.eventsource.write#system-diagnostics-tracing-eventsource-write-1(system-string-system-diagnostics-tracing-eventsourceoptions@-system-guid@-system-guid@-0@)">EventSource.Write&lt;T&gt;(string, ref EventSourceOptions, ref Guid, ref Guid, ref T)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.diagnostics.tracing.eventsource.name">EventSource.Name</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.diagnostics.tracing.eventsource.guid">EventSource.Guid</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.diagnostics.tracing.eventsource.settings">EventSource.Settings</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.diagnostics.tracing.eventsource.constructionexception">EventSource.ConstructionException</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.diagnostics.tracing.eventsource.currentthreadactivityid">EventSource.CurrentThreadActivityId</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.diagnostics.tracing.eventsource.eventcommandexecuted">EventSource.EventCommandExecuted</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.gettype">object.GetType()</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)">object.Equals(object)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)">object.Equals(object, object)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.referenceequals">object.ReferenceEquals(object, object)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.gethashcode">object.GetHashCode()</a>
    </div>
  </dd></dl>

  <dl class="typelist extensionMethods">
    <dt>扩展方法</dt>
    <dd>
  <div>
      <a class="xref" href="Fantasy.JsonHelper.html#Fantasy_JsonHelper_ToJson__1___0_">JsonHelper.ToJson&lt;T&gt;(T)</a>
  </div>
  </dd></dl>





  <h2 class="section" id="constructors">构造函数
</h2>


  <a id="Fantasy_RecyclableMemoryStreamManager_Events__ctor_" data-uid="Fantasy.RecyclableMemoryStreamManager.Events.#ctor*"></a>

  <h3 id="Fantasy_RecyclableMemoryStreamManager_Events__ctor" data-uid="Fantasy.RecyclableMemoryStreamManager.Events.#ctor">
  Events()
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public Events()</code></pre>
  </div>













  <h2 class="section" id="fields">字段
</h2>



  <h3 id="Fantasy_RecyclableMemoryStreamManager_Events_Writer" data-uid="Fantasy.RecyclableMemoryStreamManager.Events.Writer">
  Writer
  
  </h3>

  <div class="markdown level1 summary"><p>静态日志对象，通过它写入所有事件。</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static RecyclableMemoryStreamManager.Events Writer</code></pre>
  </div>




  <h4 class="section">字段值</h4>
  <dl class="parameters">
    <dt><a class="xref" href="Fantasy.RecyclableMemoryStreamManager.html">RecyclableMemoryStreamManager</a>.<a class="xref" href="Fantasy.RecyclableMemoryStreamManager.Events.html">Events</a></dt>
    <dd></dd>
  </dl>









  <h2 class="section" id="methods">方法
</h2>


  <a id="Fantasy_RecyclableMemoryStreamManager_Events_MemoryStreamCreated_" data-uid="Fantasy.RecyclableMemoryStreamManager.Events.MemoryStreamCreated*"></a>

  <h3 id="Fantasy_RecyclableMemoryStreamManager_Events_MemoryStreamCreated_System_Guid_System_String_System_Int64_System_Int64_" data-uid="Fantasy.RecyclableMemoryStreamManager.Events.MemoryStreamCreated(System.Guid,System.String,System.Int64,System.Int64)">
  MemoryStreamCreated(Guid, string, long, long)
  
  </h3>

  <div class="markdown level1 summary"><p>在创建流对象时记录的事件。</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">[Event(1, Level = EventLevel.Verbose, Version = 2)]
public void MemoryStreamCreated(Guid guid, string tag, long requestedSize, long actualSize)</code></pre>
  </div>

  <h4 class="section">参数</h4>
  <dl class="parameters">
    <dt><code>guid</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.guid">Guid</a></dt>
    <dd><p>此流的唯一 ID。</p>
</dd>
    <dt><code>tag</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
    <dd><p>临时 ID，通常表示当前使用情况。</p>
</dd>
    <dt><code>requestedSize</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int64">long</a></dt>
    <dd><p>流的请求大小。</p>
</dd>
    <dt><code>actualSize</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int64">long</a></dt>
    <dd><p>从池中分配给流的实际大小。</p>
</dd>
  </dl>












  <a id="Fantasy_RecyclableMemoryStreamManager_Events_MemoryStreamDiscardBuffer_" data-uid="Fantasy.RecyclableMemoryStreamManager.Events.MemoryStreamDiscardBuffer*"></a>

  <h3 id="Fantasy_RecyclableMemoryStreamManager_Events_MemoryStreamDiscardBuffer_System_Guid_System_String_Fantasy_RecyclableMemoryStreamManager_Events_MemoryStreamBufferType_Fantasy_RecyclableMemoryStreamManager_Events_MemoryStreamDiscardReason_System_Int64_System_Int64_System_Int64_System_Int64_System_Int64_System_Int64_" data-uid="Fantasy.RecyclableMemoryStreamManager.Events.MemoryStreamDiscardBuffer(System.Guid,System.String,Fantasy.RecyclableMemoryStreamManager.Events.MemoryStreamBufferType,Fantasy.RecyclableMemoryStreamManager.Events.MemoryStreamDiscardReason,System.Int64,System.Int64,System.Int64,System.Int64,System.Int64,System.Int64)">
  MemoryStreamDiscardBuffer(Guid, string, MemoryStreamBufferType, MemoryStreamDiscardReason, long, long, long, long, long, long)
  
  </h3>

  <div class="markdown level1 summary"><p>当缓冲区被丢弃时记录的事件（没有放回池中，而是交由 GC 清理）。</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">[Event(10, Level = EventLevel.Warning, Version = 2)]
public void MemoryStreamDiscardBuffer(Guid guid, string tag, RecyclableMemoryStreamManager.Events.MemoryStreamBufferType bufferType, RecyclableMemoryStreamManager.Events.MemoryStreamDiscardReason reason, long smallBlocksFree, long smallPoolBytesFree, long smallPoolBytesInUse, long largeBlocksFree, long largePoolBytesFree, long largePoolBytesInUse)</code></pre>
  </div>

  <h4 class="section">参数</h4>
  <dl class="parameters">
    <dt><code>guid</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.guid">Guid</a></dt>
    <dd><p>唯一的流 ID。</p>
</dd>
    <dt><code>tag</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
    <dd><p>临时 ID，通常表示当前使用情况。</p>
</dd>
    <dt><code>bufferType</code> <a class="xref" href="Fantasy.RecyclableMemoryStreamManager.html">RecyclableMemoryStreamManager</a>.<a class="xref" href="Fantasy.RecyclableMemoryStreamManager.Events.html">Events</a>.<a class="xref" href="Fantasy.RecyclableMemoryStreamManager.Events.MemoryStreamBufferType.html">MemoryStreamBufferType</a></dt>
    <dd><p>被丢弃的缓冲区类型。</p>
</dd>
    <dt><code>reason</code> <a class="xref" href="Fantasy.RecyclableMemoryStreamManager.html">RecyclableMemoryStreamManager</a>.<a class="xref" href="Fantasy.RecyclableMemoryStreamManager.Events.html">Events</a>.<a class="xref" href="Fantasy.RecyclableMemoryStreamManager.Events.MemoryStreamDiscardReason.html">MemoryStreamDiscardReason</a></dt>
    <dd><p>丢弃原因。</p>
</dd>
    <dt><code>smallBlocksFree</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int64">long</a></dt>
    <dd><p>小块池中的空闲块数。</p>
</dd>
    <dt><code>smallPoolBytesFree</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int64">long</a></dt>
    <dd><p>小块池中的空闲字节数。</p>
</dd>
    <dt><code>smallPoolBytesInUse</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int64">long</a></dt>
    <dd><p>从小块池中使用的字节数。</p>
</dd>
    <dt><code>largeBlocksFree</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int64">long</a></dt>
    <dd><p>大缓冲区池中的空闲块数。</p>
</dd>
    <dt><code>largePoolBytesFree</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int64">long</a></dt>
    <dd><p>大缓冲区池中的空闲字节数。</p>
</dd>
    <dt><code>largePoolBytesInUse</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int64">long</a></dt>
    <dd><p>从大缓冲区池中使用的字节数。</p>
</dd>
  </dl>












  <a id="Fantasy_RecyclableMemoryStreamManager_Events_MemoryStreamDisposed_" data-uid="Fantasy.RecyclableMemoryStreamManager.Events.MemoryStreamDisposed*"></a>

  <h3 id="Fantasy_RecyclableMemoryStreamManager_Events_MemoryStreamDisposed_System_Guid_System_String_System_Int64_System_String_System_String_" data-uid="Fantasy.RecyclableMemoryStreamManager.Events.MemoryStreamDisposed(System.Guid,System.String,System.Int64,System.String,System.String)">
  MemoryStreamDisposed(Guid, string, long, string, string)
  
  </h3>

  <div class="markdown level1 summary"><p>当流被释放时记录的事件。</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">[Event(2, Level = EventLevel.Verbose, Version = 3)]
public void MemoryStreamDisposed(Guid guid, string tag, long lifetimeMs, string allocationStack, string disposeStack)</code></pre>
  </div>

  <h4 class="section">参数</h4>
  <dl class="parameters">
    <dt><code>guid</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.guid">Guid</a></dt>
    <dd><p>此流的唯一 ID。</p>
</dd>
    <dt><code>tag</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
    <dd><p>临时 ID，通常表示当前使用情况。</p>
</dd>
    <dt><code>lifetimeMs</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int64">long</a></dt>
    <dd><p>流的生命周期（毫秒）。</p>
</dd>
    <dt><code>allocationStack</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
    <dd><p>初始分配的调用堆栈。</p>
</dd>
    <dt><code>disposeStack</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
    <dd><p>释放的调用堆栈。</p>
</dd>
  </dl>












  <a id="Fantasy_RecyclableMemoryStreamManager_Events_MemoryStreamDoubleDispose_" data-uid="Fantasy.RecyclableMemoryStreamManager.Events.MemoryStreamDoubleDispose*"></a>

  <h3 id="Fantasy_RecyclableMemoryStreamManager_Events_MemoryStreamDoubleDispose_System_Guid_System_String_System_String_System_String_System_String_" data-uid="Fantasy.RecyclableMemoryStreamManager.Events.MemoryStreamDoubleDispose(System.Guid,System.String,System.String,System.String,System.String)">
  MemoryStreamDoubleDispose(Guid, string, string, string, string)
  
  </h3>

  <div class="markdown level1 summary"><p>当流第二次被释放时记录的事件。</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">[Event(3, Level = EventLevel.Critical)]
public void MemoryStreamDoubleDispose(Guid guid, string tag, string allocationStack, string disposeStack1, string disposeStack2)</code></pre>
  </div>

  <h4 class="section">参数</h4>
  <dl class="parameters">
    <dt><code>guid</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.guid">Guid</a></dt>
    <dd><p>此流的唯一 ID。</p>
</dd>
    <dt><code>tag</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
    <dd><p>临时 ID，通常表示当前使用情况。</p>
</dd>
    <dt><code>allocationStack</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
    <dd><p>初始分配的调用堆栈。</p>
</dd>
    <dt><code>disposeStack1</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
    <dd><p>第一次释放的调用堆栈。</p>
</dd>
    <dt><code>disposeStack2</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
    <dd><p>第二次释放的调用堆栈。</p>
</dd>
  </dl>








  <h4 class="section" id="Fantasy_RecyclableMemoryStreamManager_Events_MemoryStreamDoubleDispose_System_Guid_System_String_System_String_System_String_System_String__remarks">备注</h4>
  <div class="markdown level1 remarks"><p>注意：只有在 RecyclableMemoryStreamManager.GenerateCallStacks 为 true 时，堆栈才会被填充。</p>
</div>




  <a id="Fantasy_RecyclableMemoryStreamManager_Events_MemoryStreamFinalized_" data-uid="Fantasy.RecyclableMemoryStreamManager.Events.MemoryStreamFinalized*"></a>

  <h3 id="Fantasy_RecyclableMemoryStreamManager_Events_MemoryStreamFinalized_System_Guid_System_String_System_String_" data-uid="Fantasy.RecyclableMemoryStreamManager.Events.MemoryStreamFinalized(System.Guid,System.String,System.String)">
  MemoryStreamFinalized(Guid, string, string)
  
  </h3>

  <div class="markdown level1 summary"><p>当流被终结时记录的事件。</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">[Event(4, Level = EventLevel.Error)]
public void MemoryStreamFinalized(Guid guid, string tag, string allocationStack)</code></pre>
  </div>

  <h4 class="section">参数</h4>
  <dl class="parameters">
    <dt><code>guid</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.guid">Guid</a></dt>
    <dd><p>此流的唯一 ID。</p>
</dd>
    <dt><code>tag</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
    <dd><p>临时 ID，通常表示当前使用情况。</p>
</dd>
    <dt><code>allocationStack</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
    <dd><p>初始分配的调用堆栈。</p>
</dd>
  </dl>








  <h4 class="section" id="Fantasy_RecyclableMemoryStreamManager_Events_MemoryStreamFinalized_System_Guid_System_String_System_String__remarks">备注</h4>
  <div class="markdown level1 remarks"><p>注意：只有在 RecyclableMemoryStreamManager.GenerateCallStacks 为 true 时，堆栈才会被填充。</p>
</div>




  <a id="Fantasy_RecyclableMemoryStreamManager_Events_MemoryStreamManagerInitialized_" data-uid="Fantasy.RecyclableMemoryStreamManager.Events.MemoryStreamManagerInitialized*"></a>

  <h3 id="Fantasy_RecyclableMemoryStreamManager_Events_MemoryStreamManagerInitialized_System_Int32_System_Int32_System_Int32_" data-uid="Fantasy.RecyclableMemoryStreamManager.Events.MemoryStreamManagerInitialized(System.Int32,System.Int32,System.Int32)">
  MemoryStreamManagerInitialized(int, int, int)
  
  </h3>

  <div class="markdown level1 summary"><p>当 RecyclableMemoryStreamManager 被初始化时记录的事件。</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">[Event(6, Level = EventLevel.Informational)]
public void MemoryStreamManagerInitialized(int blockSize, int largeBufferMultiple, int maximumBufferSize)</code></pre>
  </div>

  <h4 class="section">参数</h4>
  <dl class="parameters">
    <dt><code>blockSize</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd><p>块的大小，以字节为单位。</p>
</dd>
    <dt><code>largeBufferMultiple</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd><p>大缓冲区的倍数，以字节为单位。</p>
</dd>
    <dt><code>maximumBufferSize</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd><p>最大缓冲区大小，以字节为单位。</p>
</dd>
  </dl>












  <a id="Fantasy_RecyclableMemoryStreamManager_Events_MemoryStreamNewBlockCreated_" data-uid="Fantasy.RecyclableMemoryStreamManager.Events.MemoryStreamNewBlockCreated*"></a>

  <h3 id="Fantasy_RecyclableMemoryStreamManager_Events_MemoryStreamNewBlockCreated_System_Int64_" data-uid="Fantasy.RecyclableMemoryStreamManager.Events.MemoryStreamNewBlockCreated(System.Int64)">
  MemoryStreamNewBlockCreated(long)
  
  </h3>

  <div class="markdown level1 summary"><p>当创建新的块时记录的事件。</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">[Event(7, Level = EventLevel.Warning, Version = 2)]
public void MemoryStreamNewBlockCreated(long smallPoolInUseBytes)</code></pre>
  </div>

  <h4 class="section">参数</h4>
  <dl class="parameters">
    <dt><code>smallPoolInUseBytes</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int64">long</a></dt>
    <dd><p>当前在小块池中使用的字节数。</p>
</dd>
  </dl>












  <a id="Fantasy_RecyclableMemoryStreamManager_Events_MemoryStreamNewLargeBufferCreated_" data-uid="Fantasy.RecyclableMemoryStreamManager.Events.MemoryStreamNewLargeBufferCreated*"></a>

  <h3 id="Fantasy_RecyclableMemoryStreamManager_Events_MemoryStreamNewLargeBufferCreated_System_Int64_System_Int64_" data-uid="Fantasy.RecyclableMemoryStreamManager.Events.MemoryStreamNewLargeBufferCreated(System.Int64,System.Int64)">
  MemoryStreamNewLargeBufferCreated(long, long)
  
  </h3>

  <div class="markdown level1 summary"><p>当创建新的大缓冲区时记录的事件。</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">[Event(8, Level = EventLevel.Warning, Version = 3)]
public void MemoryStreamNewLargeBufferCreated(long requiredSize, long largePoolInUseBytes)</code></pre>
  </div>

  <h4 class="section">参数</h4>
  <dl class="parameters">
    <dt><code>requiredSize</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int64">long</a></dt>
    <dd><p>请求的大小。</p>
</dd>
    <dt><code>largePoolInUseBytes</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int64">long</a></dt>
    <dd><p>当前在大缓冲区池中使用的字节数。</p>
</dd>
  </dl>












  <a id="Fantasy_RecyclableMemoryStreamManager_Events_MemoryStreamNonPooledLargeBufferCreated_" data-uid="Fantasy.RecyclableMemoryStreamManager.Events.MemoryStreamNonPooledLargeBufferCreated*"></a>

  <h3 id="Fantasy_RecyclableMemoryStreamManager_Events_MemoryStreamNonPooledLargeBufferCreated_System_Guid_System_String_System_Int64_System_String_" data-uid="Fantasy.RecyclableMemoryStreamManager.Events.MemoryStreamNonPooledLargeBufferCreated(System.Guid,System.String,System.Int64,System.String)">
  MemoryStreamNonPooledLargeBufferCreated(Guid, string, long, string)
  
  </h3>

  <div class="markdown level1 summary"><p>当创建的缓冲区过大无法放入池中时记录的事件。</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">[Event(9, Level = EventLevel.Verbose, Version = 3)]
public void MemoryStreamNonPooledLargeBufferCreated(Guid guid, string tag, long requiredSize, string allocationStack)</code></pre>
  </div>

  <h4 class="section">参数</h4>
  <dl class="parameters">
    <dt><code>guid</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.guid">Guid</a></dt>
    <dd><p>唯一的流 ID。</p>
</dd>
    <dt><code>tag</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
    <dd><p>临时 ID，通常表示当前使用情况。</p>
</dd>
    <dt><code>requiredSize</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int64">long</a></dt>
    <dd><p>调用者请求的大小。</p>
</dd>
    <dt><code>allocationStack</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
    <dd><p>请求流的调用堆栈。</p>
</dd>
  </dl>








  <h4 class="section" id="Fantasy_RecyclableMemoryStreamManager_Events_MemoryStreamNonPooledLargeBufferCreated_System_Guid_System_String_System_Int64_System_String__remarks">备注</h4>
  <div class="markdown level1 remarks"><p>注意：只有在 RecyclableMemoryStreamManager.GenerateCallStacks 为 true 时，堆栈才会被填充。</p>
</div>




  <a id="Fantasy_RecyclableMemoryStreamManager_Events_MemoryStreamOverCapacity_" data-uid="Fantasy.RecyclableMemoryStreamManager.Events.MemoryStreamOverCapacity*"></a>

  <h3 id="Fantasy_RecyclableMemoryStreamManager_Events_MemoryStreamOverCapacity_System_Guid_System_String_System_Int64_System_Int64_System_String_" data-uid="Fantasy.RecyclableMemoryStreamManager.Events.MemoryStreamOverCapacity(System.Guid,System.String,System.Int64,System.Int64,System.String)">
  MemoryStreamOverCapacity(Guid, string, long, long, string)
  
  </h3>

  <div class="markdown level1 summary"><p>当流的容量超过最大值时记录的事件。</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">[Event(11, Level = EventLevel.Error, Version = 3)]
public void MemoryStreamOverCapacity(Guid guid, string tag, long requestedCapacity, long maxCapacity, string allocationStack)</code></pre>
  </div>

  <h4 class="section">参数</h4>
  <dl class="parameters">
    <dt><code>guid</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.guid">Guid</a></dt>
    <dd><p>唯一的流 ID。</p>
</dd>
    <dt><code>tag</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
    <dd><p>临时 ID，通常表示当前使用情况。</p>
</dd>
    <dt><code>requestedCapacity</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int64">long</a></dt>
    <dd><p>请求的容量。</p>
</dd>
    <dt><code>maxCapacity</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int64">long</a></dt>
    <dd><p>最大容量，由 RecyclableMemoryStreamManager 配置。</p>
</dd>
    <dt><code>allocationStack</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
    <dd><p>容量请求的调用堆栈。</p>
</dd>
  </dl>








  <h4 class="section" id="Fantasy_RecyclableMemoryStreamManager_Events_MemoryStreamOverCapacity_System_Guid_System_String_System_Int64_System_Int64_System_String__remarks">备注</h4>
  <div class="markdown level1 remarks"><p>注意：只有在 RecyclableMemoryStreamManager.GenerateCallStacks 为 true 时，堆栈才会被填充。</p>
</div>




  <a id="Fantasy_RecyclableMemoryStreamManager_Events_MemoryStreamToArray_" data-uid="Fantasy.RecyclableMemoryStreamManager.Events.MemoryStreamToArray*"></a>

  <h3 id="Fantasy_RecyclableMemoryStreamManager_Events_MemoryStreamToArray_System_Guid_System_String_System_String_System_Int64_" data-uid="Fantasy.RecyclableMemoryStreamManager.Events.MemoryStreamToArray(System.Guid,System.String,System.String,System.Int64)">
  MemoryStreamToArray(Guid, string, string, long)
  
  </h3>

  <div class="markdown level1 summary"><p>当流的 ToArray 方法被调用时记录的事件。</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">[Event(5, Level = EventLevel.Verbose, Version = 2)]
public void MemoryStreamToArray(Guid guid, string tag, string stack, long size)</code></pre>
  </div>

  <h4 class="section">参数</h4>
  <dl class="parameters">
    <dt><code>guid</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.guid">Guid</a></dt>
    <dd><p>此流的唯一 ID。</p>
</dd>
    <dt><code>tag</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
    <dd><p>临时 ID，通常表示当前使用情况。</p>
</dd>
    <dt><code>stack</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
    <dd><p>ToArray 方法的调用堆栈。</p>
</dd>
    <dt><code>size</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int64">long</a></dt>
    <dd><p>流的长度。</p>
</dd>
  </dl>








  <h4 class="section" id="Fantasy_RecyclableMemoryStreamManager_Events_MemoryStreamToArray_System_Guid_System_String_System_String_System_Int64__remarks">备注</h4>
  <div class="markdown level1 remarks"><p>注意：只有在 RecyclableMemoryStreamManager.GenerateCallStacks 为 true 时，堆栈才会被填充。</p>
</div>





</article>


        
      </div>

      <div class="affix">
        <nav id="affix"></nav>
      </div>
    </main>

    <div class="container-xxl search-results" id="search-results"></div>

    <footer class="border-top">
      <div class="container-xxl">
        <div class="flex-fill">
          <span>Made with <a href="https://dotnet.github.io/docfx">docfx</a></span>
        </div>
      </div>
    </footer>
  </body>
</html>